package five_row;

public class GoBang extends five_row {
	public static int Go(boolean Object_1, int i, int j) {
		System.out.println("i--"+i+"j---"+j+"Object_1---"+Object_1);
		System.out.println("GoBang ---------zhixingle");
		Up up = new Up();
		LeftUp leftUp = new LeftUp();
		Left left = new Left();
		LeftDown leftDown = new LeftDown();
		int str = 0;
		int Object;
		if (Object_1 == true) {
			Object=1;
			str = 1 ;
		} else {
			Object=2;
			str = 2;
		}
		Huiqi hq=new Huiqi();
		hq.Insert(i,j);
		arr[i][j]=str;
		if (up.Up(Object, i, j) == 1 || leftUp.LeftUp(Object, i, j) == 1
				|| left.Left(Object, i, j) == 1
				|| leftDown.LeftDown(Object, i, j) == 1) {
			hq.pook();
			return 2;
		}
		if (up.Up(Object, i, j) == 0) {
			System.out.println(str + "赢了");
			hq.pook();
			return str ;
		} else if (leftUp.LeftUp(Object, i, j) == 0) {
			System.out.println(str + "赢了");
			hq.pook();
			return str ;
		} else if (left.Left(Object, i, j) == 0) {
			System.out.println(str + "赢了");
			hq.pook();
			return str ;
		} else if (leftDown.LeftDown(Object, i, j) == 0) {
			System.out.println(str + "赢了");
			hq.pook();
			return str ;
		}
		return 0;
	}
}
